package com.bk.mapper.loan;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import com.bk.entity.LoanBalance;
import com.bk.entity.LoanInfo;
import com.bk.vo.LoanInfoUserVo;

@Component
public interface LoanInfoMapper {

	/**贷款申请 存储状态*/
	int approvalLoan(LoanInfo loanInfo);

	/**判断贷款申请记录中是否有贷款账户*/
	LoanInfo isExistLoanAccount(String accountUid);

	/**更新贷款账户余额*/
	int updateLoanBalance(@Param("loanAccountId")String loanAccountId,@Param("loanBalance") double loanBalance);

	/**通过贷款序列和身份证查询贷款记录*/
	LoanInfo queryLoanInfoByLoanNum(@Param("loanNum")int loanNum);

	/**根据uid身份证更新贷款记录信息表装填以及贷款账户*/
	int updateLoanInfoStatuAndLoanAccId(@Param("uid")String uid,@Param("loanAccountId") String loanAccountId,@Param("loanNum") int loanNum,@Param("flag") int flag);

	/**根据身份证查看贷款账户余额表中是否有对应的贷款账户*/
	LoanBalance queryLoanBalanceByUid(String uid);

	/**创建贷款账户,并赋予初值*/
	int createLoanBalanceAccId(@Param("uid")String uid,@Param("loanAccountId") String loanAccountId,@Param("loanBalance") double loanBalance);

	/**获取到所有贷款申请*/
	List<LoanInfo> getAllWaitPassLoanInfo();

	/**贷款审批通过还是驳回*/
	int isPassOrRefuseLoan(String uid, String loanStatu, int loanNum,int isPassLoanState, int flag);

	/**获取到贷款驳回申请*/
	List<LoanInfo> getAllNoPassLoanInfo();


}
